/*****************************************************************************
 *   Copyright 2005 Tim A Wang
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 ****************************************************************************/
package com.jb.database.metamodel;

import java.sql.ResultSet;
import java.sql.SQLException;


public class ReferenceKey extends BaseDatabaseEntity {
    String fkColumnName;
    String fkName;
    String fkTableCatalog;
    String fkTableName;
    String fkTableSchema;
    String pkColumnName;
    String pkName;
    String pkTableCatalog;
    String pkTableName;
    String pkTableSchema;
    short deferrability;
    short deleteRule;
    short keySeq;
    short updateRule;

    public void setDeferrability(short deferrability) {
        this.deferrability = deferrability;
    }

    public short getDeferrability() {
        return deferrability;
    }

    public void setDeleteRule(short deleteRule) {
        this.deleteRule = deleteRule;
    }

    public short getDeleteRule() {
        return deleteRule;
    }

    public void setFkColumnName(String fkColumnName) {
        this.fkColumnName = fkColumnName;
    }

    public String getFkColumnName() {
        return fkColumnName;
    }

    public void setFkName(String fkName) {
        this.fkName = fkName;
    }

    public String getFkName() {
        return fkName;
    }

    public void setFkTableCatalog(String fkTableCatalog) {
        this.fkTableCatalog = fkTableCatalog;
    }

    public String getFkTableCatalog() {
        return fkTableCatalog;
    }

    public void setFkTableName(String fkTableName) {
        this.fkTableName = fkTableName;
    }

    public String getFkTableName() {
        return fkTableName;
    }

    public void setFkTableSchema(String fkTableSchema) {
        this.fkTableSchema = fkTableSchema;
    }

    public String getFkTableSchema() {
        return fkTableSchema;
    }

    public void setKeySeq(short keySeq) {
        this.keySeq = keySeq;
    }

    public short getKeySeq() {
        return keySeq;
    }

    public void setPkColumnName(String pkColumnName) {
        this.pkColumnName = pkColumnName;
    }

    public String getPkColumnName() {
        return pkColumnName;
    }

    public void setPkName(String pkName) {
        this.pkName = pkName;
    }

    public String getPkName() {
        return pkName;
    }

    public void setPkTableCatalog(String pkTableCatalog) {
        this.pkTableCatalog = pkTableCatalog;
    }

    public String getPkTableCatalog() {
        return pkTableCatalog;
    }

    public void setPkTableName(String pkTableName) {
        this.pkTableName = pkTableName;
    }

    public String getPkTableName() {
        return pkTableName;
    }

    public void setPkTableSchema(String pkTableSchema) {
        this.pkTableSchema = pkTableSchema;
    }

    public String getPkTableSchema() {
        return pkTableSchema;
    }

    public void setUpdateRule(short updateRule) {
        this.updateRule = updateRule;
    }

    public short getUpdateRule() {
        return updateRule;
    }

    public void assign(ResultSet crs) throws SQLException {
    }

    /*
    PKTABLE_CAT String => primary key table catalog being imported (may be null)

    PKTABLE_SCHEM String => primary key table schema being imported (may be null)
    PKTABLE_NAME String => primary key table name being imported
    PKCOLUMN_NAME String => primary key column name being imported

    FKTABLE_CAT String => foreign key table catalog (may be null)
    FKTABLE_SCHEM String => foreign key table schema (may be null)
    FKTABLE_NAME String => foreign key table name
    FKCOLUMN_NAME String => foreign key column name

    KEY_SEQ short => sequence number within a foreign key
    UPDATE_RULE short => What happens to a foreign key when the primary key is updated:
    importedNoAction - do not allow update of primary key if it has been imported
    importedKeyCascade - change imported key to agree with primary key update
    importedKeySetNull - change imported key to NULL if its primary key has been updated
    importedKeySetDefault - change imported key to default values if its primary key has been updated
    importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)

    DELETE_RULE short => What happens to the foreign key when primary is deleted.
    importedKeyNoAction - do not allow delete of primary key if it has been
    imported importedKeyCascade - delete rows that import a deleted key
    importedKeySetNull - change imported key to NULL if its primary key has been deleted
    importedKeyRestrict - same as importedKeyNoAction (for ODBC 2.x compatibility)
    importedKeySetDefault - change imported key to default if its primary key has been deleted

    FK_NAME String => foreign key name (may be null)
    PK_NAME String => primary key name (may be null)
    DEFERRABILITY short => can the evaluation of foreign key constraints be deferred until commit
    importedKeyInitiallyDeferred - see SQL92 for definition
    importedKeyInitiallyImmediate - see SQL92 for definition
    importedKeyNotDeferrable - see SQL92 for definitio}
    */
}
